Repository navigation
Add bounded task queue, disk admission and monitor state (#333 step 5) - #407
Conversation
# Conflicts: # oxa/oxa-work/src/lib.rs
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (5)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
First-pass review by oxa → oxc → I found two concrete defects. The first one breaks a workflow the PR itself documents.
I found nothing that weakens a scanner, the sandbox or a budget. There are also no secrets or personal paths in the diff. The PR touches the problem-report lock, but not credentials or publishing logic. TIER: T2 🤖 Generated with Claude Code (oxa review lane) |
# Conflicts: # oxa/oxa-work/src/lib.rs
…ted checkpoints (#333)
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🛡️ Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: a0a6ada024
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
| let (draft, title, body) = | ||
| save_draft(¬e.title, ¬e.notes, dirs, ctx, runner).map_err(|e| e.to_string())?; |
There was a problem hiding this comment.
🛡️ Codex Security Review
Security: Skip controller probes while drafting offline reports
When an owner runs oxa --offline work ... --report-problems for a task containing a problem note, this call builds the draft before the offline check at line 121. Draft construction runs oxc status --json, whose implementation opens fixed loopback connections to ports 8092 and 8090. Thus hard-offline mode still makes network calls, although no note text is transmitted and GitHub remains blocked. Build offline drafts without diagnostic subprocesses or enforce the network guard before invoking them.
SECURITY.md reference: oxa/SECURITY.md:L24-L24
Useful? React with 👍 / 👎.
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0731c3917d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let lock = fs::OpenOptions::new() | ||
| .read(true) | ||
| .write(true) | ||
| .mode(0o600) | ||
| .custom_flags(shadow::OWNER_FILE_FLAGS) |
There was a problem hiding this comment.
Reuse the existing task-lock implementation
The new LockedTask::open duplicates the task-lock opening, ownership validation and acquisition logic in lock_task in this same file, which remains used by tree::transfer_branch. Execution/publication and branch transfer therefore maintain separate implementations of the same security-sensitive locking responsibility. Extend the existing helper to support opening without creation and call it here so both paths retain one implementation, as required by the repository's reuse rule.
AGENTS.md reference: AGENTS.md:L32-L35
Useful? React with 👍 / 👎.
| if binding != &canonical || task.branch != binding.branch { | ||
| return Err("prepared task does not own the bound native attempt".into()); | ||
| } | ||
| task.id.clone_from(&binding.native_task_id); |
There was a problem hiding this comment.
Support branch handoff between native attempts
When a finished native attempt is followed by another admitted packet for the same branch, the new binding produces a different task ID and therefore a different worktree directory, while the previous retained worktree still has that branch checked out. tree::prepare releases a previous worktree's branch only when Task::reviewed_head() returns a value, but that method recognizes only pr-<number>-<head> IDs, never these board-... IDs. Consequently the next attempt reaches git worktree add without releasing the branch and is blocked before its worker starts. Add a native-binding-aware handoff that safely detaches the finished prior worktree while preserving its contents.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
🛡️ Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: 0731c3917d
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
| if let Some(file) = input_file(entry)? { | ||
| if files.len() == MAX_QUEUE_FILES { | ||
| return Err(format!( |
There was a problem hiding this comment.
🛡️ Codex Security Review
Security: Bound all queue directory entries before filtering
MAX_QUEUE_FILES is applied only after input_file accepts a visible regular .json; hidden files, non-JSON files, and nonregular .json entries are uncounted. In the documented repository-controlled --queue ./tasks flow, an author can populate that directory with arbitrarily many ignored entries. Every watch iteration traverses them before admission, keeping the controller CPU-bound and delaying all tasks despite the aggregate limits. Fresh evidence beyond the earlier aggregate-input report is that the new 256-file cap applies only after filtering. Count all DirEntrys before calling input_file.
SECURITY.md reference: SECURITY.md:L16-L16
Useful? React with 👍 / 👎.
Feature A (native work board). Owner acceptance #1214
T3 — retain the explicit
oxa work --queueexecution queue (#333), dependent on #397. Ready at the protected checkpoint refresh.The queue is opt-in and sequential by default. It retains oldest-input ordering, disk admission, task status, report serialization and draining of admitted workers. It consumes private runner checkpoints and the trusted supervisor; it does not replace the native helper spool/board runner. Main's helper_queue and this execution queue retain separate modules and both histories.
Repairs reject duplicate branches across watched files, include common Git storage in the free-space floor, and count real surviving task leases after their input disappears. Archived unadmitted jobs are withdrawn while active identities remain. Shared publication fixes from #397 scrub notes before persistence/output, preserve origin host and owner PR text, retain pending saves through reports, and require fresh checks on explicit action reruns. Ordinary action recovery cannot reseal an unchecked head.
Removes: the inlined single-task CLI body moves into Context::planned so single-task/queue paths share trusted APIs. Inherited runner implementations are reconciled with main; helper06585e84, original drain/checkout controls and source history remain. No limits, timers, budgets or scanners are weakened. The generic content-scanner claim was adjudicated against the stated contract in397comment6958079581; no scanner feature is added.
Validation: archive regression failed44123544179 then passed44125941626. Three queue-specific controls failed44135796040 then passed44137411135; the shared recovery controls failed44146808409 then passed current-parent lane44148608394 and queue lane44148660051. Current main-conflict refresh4a6c1f60 includes parentcb7ae1fd; draft checks44155735350 passed and lane44155721637 is running. Synthetic isolated-HOME fixtures, mock providers, no local builds/tests or real credentials. Current required CI, Cloud qualification and narrow execution-boundary read remain gates. Landing follows #397, then #749/#776; auto-approver owns review requests.
Main refresh
96b609f8e9c5f4a596fc07a8751c2779e2ca8ca5merges main78d1dda2. The two conflict resolutions retain main's protected work-storage check, committed verification and mirrors, plus this PR's queue dispatch and its inherited #397 publication and report paths. The queue module, report adapter and dedicated queue tests are byte-identical to4a6c1f60. The shared dispatch has formatting changes from composing the routes.Ports the local execution portion of night-watch + feeder + goal-loop from #307. Landing still follows #397. Hosted lane 44174222208 and draft checks 44174235872 record qualification for this head. The required draft gate passed and the PR is ready for full required checks.
Queue bounds, reporting lease and current main refresh
The test-first x86_64 job ran 1,415 tests and failed on the two intended controls. Repaired head
e89fb4e0passed on x86_64 and ARM64. Queue reads are limited to regular files up to 1 MiB and 128 tasks per file. A surviving host report command keeps the same per-user reporting lease. The queue and publication tests reuse the repository fixture.Removes: the duplicate queue test fixture implementation and the unbounded read path.
Earlier refreshed head
4227fe3cda4aedb0a806ba6bb511f7eaaef6e34cincludes mainedae4644through #397. It preserves the queue's native execution path and uses the shared bounded report runner. Work1 owns the typed Claims binding and Work2 owns the pre-hardlink call. #407 owns native completion and process reconciliation. Landing follows #397.Current required checks · Current hosted lane
Protected checkpoint refresh
Head
1bf6389508b235af7964f9f549996283ece92712carries mainf02fc17bthrough #397. Publication retries retain main's protected storage checks and the queue retains its report lease. GitHub confirmed this head is mergeable. It passed the draft required gate and was marked ready. The exact hosted lane tracks the refreshed head.Continuous task ownership
The prior full run caught a contention failure between execution and reporting in the concurrent report test. At current head
7bd662d80968683e5f016dff0cac38623fe57ad7, the trusted CLI holds the same protected task lock across execution, publication and reporting. Commands still inherit it so a surviving process retains ownership. The queue continues to serialize reports with its distinct per-user lease.Before-fix required job · Fixed x86_64 and ARM64 lane · Fixed full required checks
Native completion and original lease fencing
Head
de1e27fc43025be662704a049bd3366c7ee20782carries the shared report deadline refresh and Work1's exact public Core contracte7866a56. The typed caller uses the original binding's native task ID and branch, supplies the held task lock to the worker, and uses the existing queue loop. Once the worker joins, the queue reacquires the protected task lock, reads the current durable task checkpoint, and holds that lock through release of the original full lease. Incomplete or stale results retain their reservation. Publication and helper activation remain off.The exact Work1 required checks and Work2 hosted consumer lane passed. The scoped local oxa-work compiler check passed. Hosted controls for this composed head cover exact identity, a surviving task lock, stale and incomplete checkpoints, and one dispatch/one release through the existing queue.
Composed required checks · Composed hosted lane
The composed head passed the full required workflow and both hosted architecture jobs. The x86_64 log confirms the exact durable completion control, one native dispatch and release before its queue event, and the concurrent reporting regression. Hosted regression log · Exact Codex review
Protected native CLI execution
Head
0872759532440a3a5e9804f61c8ab3703e0a4b6fpreserves the #1090 PR packet route and carries the refreshed #397. The explicit native command consumes one admitted packet from the existing protected spool. It supplies the held task lock to the existing task runner and binds the retained started packet to the original attempt generation. On completion it joins the worker and holds the task lock through the durable checkpoint read and exact lease release. The command is disabled by default and runs offline pending deterministic supervisor isolation.The queue now limits retained task identities, total input bytes and the number of input files. The test-first lane reproduced both aggregate-limit defects. Hosted oxa-work/oxa-cli qualification and required checks track this head. Work2 owns the composed refill-to-native real CLI fixture on #1223. Publication and helper activation remain off.
Current native entry and #1192 composition
The previous lane caught a guidance symbol renamed by #1090. This head uses the shared runner guidance function. A merge preview with #1192
f75653c3composes the common-directory dispatch and the same protected storage guard with the held-lock native queue path. Hosted lane · Required checks.Head
49ed0fce026a930f1d6838990981f89e87fedb7a.The required workflow, CodeQL and the hosted oxa-work/oxa-cli lane passed at this head. The x86_64 log confirms the two aggregate queue limits, generation-bound spool recovery and whole-task lease settlement. Work2's composed real CLI fixture remains the end-to-end qualification. Hosted regression log · CodeQL
Conflict refresh after #1043 and #1099
Head
a0a6ada024e43d38426622129d2cfd2042f08b03. The normal merge carries #1043 and #1099 through the existing held-lock execution path. The CLI native adapter, queue dispatcher and spool match the previously qualified versions. The issue-only composed CLI and the separate reviewed PR source guard are still in qualification.Hosted lane · Required checks
Queue conflict resolution after #397 landed
Head
0731c3917de4ac7f228ee792e5dd53a0355c3056merges landed #3970095e879after GitHub removed #407 for a merge conflict. The approved added and removed lines match in 15 of 16 paths. The remaining visibility change already landed through #1192. The native CLI, queue, original-lease settlement and spool are byte-identical to the approved head.The required checks and CodeQL passed. The hosted lane passed 1,517 tests on each architecture, including generation-bound recovery and exact durable settlement. Required checks · CodeQL · Hosted oxa-work/oxa-cli lane